<?php
/**
* @package odal.core.element
* @author Volker Schubert <vs@brixlent.de>
* @since 1.1rc1
* @version $Id: value.php,v 1.2 2005/04/15 13:54:04 vschubert Exp $
*/
/**
* @link simpleattribute
* @access private
*/
require_once ('odal/meta/simpleattribute.php');
/**
* @link datatypeenumeration
* @access private
*/
require_once ('odal/meta/datatypeenumeration.php');
/**
* @link node
* @access private
*/
require_once ('odal/node.php');
/**
* Value of an Element
* 
* Can be ot the following types:<br>
* - simpleValue<br>
* - uniqueValue<br>
* - blobValue<br>
* - clobValue<br>
* distiguished by type of simpleAttribute
* 
* @package odal.core.element
* @author Volker Schubert <vs@brixlent.de>
* @since 1.1rc1
* @version $Id: value.php,v 1.2 2005/04/15 13:54:04 vschubert Exp $
* @table BLOBVALUE
* @table CLOBVALUE
* @table SIMPLEVALUE
* @table UNIQUEVALUE
*/
class odal_Value extends odal_Node{
    /**#@+
     * @access private
     */
    var $m_element;
	var $m_datatypeEnumerationName;
	var $m_simpleAttributeName;
    /**#@-*/
	/**
	* Never instantiate odal_Value directly. Use odal_Element->createValue instead.
	* @see odal_Element::createValue() 
	* @param datatypeEnumeration $datatypeEnumeration
	* @param simpleAttribute $simpleAttribute
	* @param int $id
	* @param string $content
	* @param datetime $creatingDate
	* @param int $creater
	* @param datetime $modifyingDate
	* @param int $modfier
	* @return void
	*/
	function odal_Value( &$element, $simpleAttributeName, $datatypeEnumerationName, $id, $content, $creatingDate = null, $creater = 0, $modifyingDate = null, $modifier = 0 ){
		$this->_createValue( $element, $simpleAttributeName, $datatypeEnumerationName, $id, $content, $creatingDate, $creater, $modifyingDate, $modifier);
	}//odal_Value
	
	function _createValue( &$element, $simpleAttributeName, $datatypeEnumerationName, $id, $content, $creatingDate = null, $creater = 0, $modifyingDate = null, $modifier = 0 ){
		$this->m_id = $id;
		$this->m_name = $content;
		$this->m_element =& $element;
		$this->m_simpleAttributeName = $simpleAttributeName;
		$this->m_datatypeEnumerationName = $datatypeEnumerationName;
		$this->m_creatingDate = $creatingDate;
		$this->m_creater = $creater;
		$this->m_modifyingDate = $modifyingDate;
		$this->m_modifier = $modifier;
	}//_createSimpleValue


	function &getElement(){
		return $this->m_element;
	}//getElement

	/**
	 * returns m_content, type is depending on type of simpleAttribute
	 */
	function getContent(){
		return $this->getName();
	}//getContent

	/**
	 * returns m_attribute
	 */
	function &getSimpleAttributeName(){
		return $this->m_simpleAttributeName;
	}//getSimpleAttribute
	
	function getDatatypeEnumerationName(){
		return $this->m_datatypeEnumerationName;
	}//getDatatypeEnumeration

	function setContent( $content ){
		$this->update( $content );
	}//getContent

	function setDatatypeEnumeration( &$datatypeEnumerationName ){
		$this->m_datatypeEnumerationName = $datatypeEnumerationName;
	}//setDatatypeEnumeration
}//odal_Vssalue